class PublicBtnItem {
  String? key;
  String? title;
  int? view;
  Display? display;
  BtnClick? click;

  PublicBtnItem({this.key, this.title, this.view, this.display, this.click});

  PublicBtnItem.fromJson(Map<String, dynamic> json) {
    if (json["key"] is String) {
      key = json["key"];
    }
    if (json["title"] is String) {
      title = json["title"];
    }
    if (json["view"] is num) {
      view = (json["view"] as num).toInt();
    }
    if (json["display"] is Map) {
      display = json["display"] == null ? null : Display.fromJson(json["display"]);
    }
    if (json["click"] is Map) {
      click = json["click"] == null ? null : BtnClick.fromJson(json["click"]);
    }
  }

  static List<PublicBtnItem> fromList(List<Map<String, dynamic>> list) {
    return list.map(PublicBtnItem.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["key"] = key;
    json["title"] = title;
    json["view"] = view;
    if (display != null) {
      json["display"] = display?.toJson();
    }
    if (click != null) {
      json["click"] = click?.toJson();
    }
    return json;
  }
}

class Display {
  List<String>? tips;
  String? subtitle;

  Display({this.tips, this.subtitle});

  Display.fromJson(Map<String, dynamic> json) {
    if (json["tips"] is List) {
      tips = json["tips"] == null ? null : List<String>.from(json["tips"]);
    }
    if (json["subtitle"] is String) {
      subtitle = json["subtitle"];
    }
  }

  static List<Display> fromList(List<Map<String, dynamic>> list) {
    return list.map(Display.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    if (tips != null) {
      json["tips"] = tips;
    }
    json["subtitle"] = subtitle;
    return json;
  }

  Display copyWith({
    List<String>? tips,
    String? subtitle,
  }) =>
      Display(
        tips: tips ?? this.tips,
        subtitle: subtitle ?? this.subtitle,
      );
}

class BtnClick {
  String? react;
  BtnClickWindow? window;
  BtnClickParams? params;
  String? option;
  String? jump;

  BtnClick({
    this.react,
    this.window,
    this.params,
    this.option,
    this.jump,
  });

  BtnClick.fromJson(Map<String, dynamic> json) {
    if (json["react"] is String) {
      react = json["react"];
    }
    if (json["window"] is Map) {
      window = json["window"] == null ? null : BtnClickWindow.fromJson(json["window"]);
    }
    if (json["params"] is Map) {
      params = json["params"] == null ? null : BtnClickParams.fromJson(json["params"]);
    }
    if (json["option"] is String) {
      option = json["option"];
    }
    if (json["jump"] is String) {
      option = json["jump"];
    }
  }

  static List<BtnClick> fromList(List<Map<String, dynamic>> list) {
    return list.map(BtnClick.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["react"] = react;
    if (window != null) {
      json["window"] = window?.toJson();
    }
    if (params != null) {
      json["params"] = params?.toJson();
    }
    json["option"] = option;
    return json;
  }
}

class BtnClickParams {
  String? value;

  List<BtnClickParamsOptionsItem>? options;

  BtnClickParams({
    this.value,
    this.options,
  });

  BtnClickParams.fromJson(Map<String, dynamic> json) {
    if (json["value"] is String) {
      value = json["value"];
    }

    if (json["options"] is List) {
      options = json["options"] == null
          ? null
          : (json["options"] as List).map((e) => BtnClickParamsOptionsItem.fromJson(e)).toList();
    }
  }

  static List<BtnClickParams> fromList(List<Map<String, dynamic>> list) {
    return list.map(BtnClickParams.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["value"] = value;
    if (options != null) {
      json["options"] = options;
    }
    return json;
  }
}

class BtnClickParamsOptionsItem {
  String? val;
  String? txt;
  BtnClickParamsOptionsItem({this.val, this.txt});
  BtnClickParamsOptionsItem.fromJson(Map<String, dynamic> json) {
    if (json["val"] is String) {
      val = json["val"];
    }
    if (json["txt"] is String) {
      txt = json["txt"];
    }
  }
  static List<BtnClickParamsOptionsItem> fromList(List<Map<String, dynamic>> list) {
    return list.map(BtnClickParamsOptionsItem.fromJson).toList();
  }
}

class BtnClickWindow {
  String? winno;
  String? main;
  String? desc;
  List<WindowBtn>? btns;

  BtnClickWindow({this.winno, this.main, this.desc, this.btns});

  BtnClickWindow.fromJson(Map<String, dynamic> json) {
    if (json["winno"] is String) {
      winno = json["winno"];
    }
    if (json["main"] is String) {
      main = json["main"];
    }
    if (json["desc"] is String) {
      desc = json["desc"];
    }
    if (json["btns"] is List) {
      btns = json["btns"] == null ? null : (json["btns"] as List).map((e) => WindowBtn.fromJson(e)).toList();
    }
  }

  static List<BtnClickWindow> fromList(List<Map<String, dynamic>> list) {
    return list.map(BtnClickWindow.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["winno"] = winno;
    json["main"] = main;
    json["desc"] = desc;
    if (btns != null) {
      json["btns"] = btns?.map((e) => e.toJson()).toList();
    }
    return json;
  }
}

class WindowBtn {
  String? btnKey;
  String? btnTxt;
  WindowBtnData? btnData;

  WindowBtn({this.btnKey, this.btnTxt, this.btnData});

  WindowBtn.fromJson(Map<String, dynamic> json) {
    if (json["btnKey"] is String) {
      btnKey = json["btnKey"];
    }
    if (json["btnTxt"] is String) {
      btnTxt = json["btnTxt"];
    }
    if (json["btnData"] is Map) {
      btnData = json["btnData"] == null ? null : WindowBtnData.fromJson(json["btnData"]);
    }
  }

  static List<WindowBtn> fromList(List<Map<String, dynamic>> list) {
    return list.map(WindowBtn.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["btnKey"] = btnKey;
    json["btnTxt"] = btnTxt;
    if (btnData != null) {
      json["btnData"] = btnData?.toJson();
    }
    return json;
  }
}

class WindowBtnData {
  WindowBtnDataClick? click;
  dynamic display;

  WindowBtnData({this.click, this.display});

  WindowBtnData.fromJson(Map<String, dynamic> json) {
    if (json["click"] is Map) {
      click = json["click"] == null ? null : WindowBtnDataClick.fromJson(json["click"]);
    }
  }

  static List<WindowBtnData> fromList(List<Map<String, dynamic>> list) {
    return list.map(WindowBtnData.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    if (click != null) {
      json["click"] = click?.toJson();
    }
    return json;
  }
}

class WindowBtnDataClick {
  String? react;
  String? option;
  String? jump;
  WindowBtnDataClickParams? params;

  WindowBtnDataClick({this.react, this.option, this.jump, this.params});

  WindowBtnDataClick.fromJson(Map<String, dynamic> json) {
    if (json["react"] is String) {
      react = json["react"];
    }
    if (json["option"] is String) {
      option = json["option"];
    }
    if (json["jump"] is String) {
      jump = json["jump"];
    }
    if (json["params"] is Map) {
      params = json["params"] == null ? null : WindowBtnDataClickParams.fromJson(json["params"]);
    }
  }

  static List<WindowBtnDataClick> fromList(List<Map<String, dynamic>> list) {
    return list.map(WindowBtnDataClick.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["react"] = react;
    json["option"] = option;
    json["jump"] = jump;
    if (params != null) {
      json["params"] = params?.toJson();
    }
    return json;
  }
}

class WindowBtnDataClickParams {
  String? query;

  WindowBtnDataClickParams({this.query});

  WindowBtnDataClickParams.fromJson(Map<String, dynamic> json) {
    if (json["query"] is String) {
      query = json["query"];
    }
  }

  static List<WindowBtnDataClickParams> fromList(List<Map<String, dynamic>> list) {
    return list.map(WindowBtnDataClickParams.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    if (query != null) {
      json["query"] = query;
    }
    return json;
  }
}
